50 '
100 '
200 ' COMMAND.COM   MODIFICATION TRANSFER PROGRAM
300 '               "RESCMDCK.BAS"                 Last Update 11/26/82
350 '                                     .        John Chapman
351 '                                              CIS 70205,1217
400 '
500 'This program will read in an unmodified COMMAND.COM (Release 1.1)
600 '     and produce an output file called COMMAND.CMD.. which can be
700 '     renamed to COMMAND.COM.. This output file will contain all of
800 '     the modifications to COMMAND.COM currently available from the
900 '     author. See COMMAND.DOC for complete list and limitations.
910 '
950 DEFINT A-Z
1000 BFIL$ = "COMMAND.COM"
1100 CFIL$ = "COMMAND.CMD"
1200 INPUT "Enter Drive where COMMAND.COM resides followed by a colon ?",DRV$
1210 BFIL$=DRV$+BFIL$
1220 CFIL$=DRV$+CFIL$
1230 '
1240 OPEN BFIL$ FOR INPUT AS #1:CLOSE #1
1250 OPEN BFIL$ AS #1 LEN=1
1260 V= VARPTR(#1)
1270 L0=PEEK(V)
1280 IF L0 <>4 THEN GOTO 5000
1290 L1=PEEK(V+17) + 256 * PEEK(V+18) 'FILESIZE IN BYTES
1300 LIMIT = L1: IF LIMIT>6800 THEN PRINT "file too large":GOTO 5000 :
2000 'check base and change files for random, size and
2100 ' equal length .. abort if not correct conditions
2200 PRINT "BASE    FILE SIZE = ",LIMIT
2300 READ T:PRINT "ORIGIN  FILE SIZE = ",T
3000 DIM BB%(6800)
3100 '
3200 FIELD #1,1 AS INB$
3300 '
3400 FOR I = 1 TO LIMIT
3410 GET #1,I
3420 BB%(I) = ASC(INB$)
3430 NEXT I
3431 CLOSE #1
3432 '
3440 READ BYTES:
3500 FOR I = 1 TO BYTES
3600 READ IKJ%,XOLD%,XNEW%
3700 IF BB%(IKJ%) <> XOLD% THEN GOTO 3950
3800 BB%(IKJ%) = XNEW%
3900 GOTO 4300
3950 PRINT "VERIFY REJECT AT ";IKJ%," (";XOLD%;" / ";XNEW%;") ":
4100 PRINT "TARGET FILE COMMAND.CMD UNUSABLE":
4200 END
4300 NEXT I
4500 '
4501 PRINT "last byte = ";IKJ%;" was ";XOLD%;" now ";XNEW%
4600 '
4610 OPEN CFIL$ FOR OUTPUT AS #2:CLOSE #2
4620 OPEN CFIL$ AS #2 LEN=1
4630 FIELD #2,1 AS INC$
4700 '
4710 FOR I = 1 TO LIMIT
4712 IF BB%(I)>255 THEN PRINT "FORMAT ERROR AT";I;" = ";BB%(I):
4720 LSET INC$ = CHR$(BB%(I))
4730 PUT #2,I
4740 NEXT I
4741 PRINT I;" Bytes Written to COMMAND.CMD"
4750 CLOSE #2
4760 '
4800 PRINT "File COMMAND.CMD Created .. Rename to Use"
4900 END
4990 ' ** DATA STATEMENT WRITE SUBROUTINE
4991 '
4999 DATA  4959,  203
5000 DATA  865, 70, 84, 868, 3, 79, 869, 1, 4
5010 DATA  870, 161, 5, 871, 2, 12, 872, 0, 1
5020 DATA  877, 163, 64, 878, 82, 163, 879, 4, 3
5030 DATA  880, 45, 1, 881, 12, 161, 882, 1, 2
5040 DATA  883, 144, 0, 885, 79, 82, 890, 232, 184
5050 DATA  1363, 0, 1, 1369, 140, 144, 1370, 200, 161
5060 DATA  1371, 43, 2, 1372, 6, 0, 1373, 159, 43
5070 DATA  1374, 15, 6, 1375, 186, 159, 1376, 16, 15
5080 DATA  1377, 0, 186, 1378, 247, 16, 1379, 226, 0
5090 DATA  1380, 11, 247, 1381, 210, 226, 1382, 116, 115
5100 DATA  3632, 232, 144, 3633, 6, 144, 3634, 0, 144
5110 DATA  3635, 232, 144, 3636, 150, 144, 3637, 0, 144
5120 DATA  3641, 190, 51, 3642, 129, 210, 3643, 0, 51
5130 DATA  3644, 232, 219, 3645, 191, 51, 3646, 255, 192
5140 DATA  3647, 60, 184, 3648, 13, 12, 3649, 116, 0
5150 DATA  3650, 9, 232, 3651, 187, 7, 3652, 45, 0
5160 DATA  3653, 47, 184, 3654, 232, 3, 3655, 7, 0
5170 DATA  3656, 1, 232, 3657, 235, 1, 3658, 61, 0
5180 DATA  3659, 144, 195, 3660, 186, 205, 3661, 87, 23
5190 DATA  3662, 14, 128, 3663, 180, 228, 3664, 9, 169
5200 DATA  3665, 205, 128, 3666, 33, 252, 3667, 180, 0
5210 DATA  3668, 42, 116, 3669, 205, 7, 3670, 33, 186
5220 DATA  3671, 152, 29, 3672, 139, 10, 3673, 240, 180
5230 DATA  3674, 209, 9, 3675, 230, 205, 3676, 3, 33
5240 DATA  3677, 240, 195, 3678, 129, 13, 3679, 198, 10
5250 DATA  3680, 51, 80, 3681, 14, 114, 3682, 139, 105
5260 DATA  3683, 217, 110, 3684, 185, 116, 3685, 3, 101
5270 DATA  3686, 0, 114, 3687, 232, 32, 3688, 9, 69
5280 DATA  3689, 251, 114, 3690, 176, 114, 3691, 32, 111
5290 DATA  3692, 232, 114, 3693, 92, 32, 3694, 1, 45
5300 DATA  3695, 139, 32, 3696, 195, 70, 3697, 139, 117
5310 DATA  3698, 202, 110, 3699, 178, 99, 3700, 100, 116
5320 DATA  3701, 246, 105, 3702, 242, 111, 3703, 134, 110
5330 DATA  3704, 196, 32, 3705, 146, 65, 3706, 179, 98
5340 DATA  3707, 45, 111, 3708, 232, 114, 3709, 17, 116
5350 DATA  3710, 1, 101, 3711, 186, 100, 3712, 104, 13
5360 DATA  3713, 14, 10, 3714, 187, 36, 3715, 45, 0
5370 DATA  3716, 47, 144, 3717, 232, 184, 3718, 178, 0
5380 DATA  3719, 0, 6, 3720, 116, 185, 3721, 151, 0
5390 DATA  3722, 114, 0, 3723, 55, 186, 3724, 172, 79
5400 DATA  3725, 58, 24, 3726, 195, 183, 3727, 116, 7
5410 DATA  3728, 4, 205, 3729, 58, 16, 3730, 199, 180
5420 DATA  3731, 117, 2, 3732, 46, 186, 3733, 232, 0
5430 DATA  3734, 216, 0, 3735, 0, 183, 3736, 114, 0
5440 DATA  3737, 41, 205, 3738, 185, 16, 3739, 108, 195
5450 DATA  3740, 7, 144, 3741, 128, 187, 3742, 60, 220
5460 DATA  3743, 13, 5, 3744, 116, 228, 3745, 11, 97
5470 DATA  3746, 176, 144, 3747, 100, 36, 3748, 246, 252
5480 DATA  3749, 228, 230, 3750, 139, 97, 3751, 200, 185
5490 DATA  3752, 232, 50, 3753, 197, 0, 3754, 0, 226
5500 DATA  3755, 114, 254, 3756, 22, 12, 3757, 138, 2
5510 DATA  3758, 196, 230, 3759, 180, 97, 3760, 0, 185
5520 DATA  3761, 3, 50, 3762, 200, 0, 3763, 172, 226
5530 DATA  3764, 60, 254, 3765, 13, 75, 3767, 11, 235
5540 DATA  3768, 180, 195, 3769, 43, 144, 3770, 205, 144
5550 DATA  3771, 33, 144, 3772, 10, 144, 3773, 192, 144
5560 DATA  3774, 117, 144, 3775, 3, 144, 3776, 233, 144
5570 DATA  3777, 94, 144, 3778, 255, 144, 3779, 186, 144
5580 DATA  3780, 72, 144, 3781, 14, 144, 3782, 180, 144
5590 DATA  3783, 9, 144, 3784, 205, 144, 3785, 33, 144
5600 DATA  3786, 235, 144, 3787, 179, 144, 4052, 140, 144
5610 DATA  4053, 200, 161, 4054, 5, 2, 4055, 192, 0
5620 DATA  4056, 0, 72, 4902, 68, 67, 4903, 69, 76
5630 DATA  4904, 76, 83, 4906, 176, 68, 4907, 5, 10
5640 DATA  4941, 68, 66, 4942, 65, 69, 4943, 84, 69
5650 DATA  4944, 69, 80, 4946, 248, 92, 4947, 9, 10
5660 DATA  4949, 84, 80, 4950, 73, 65, 4951, 77, 71
5670 DATA  4954, 139, 248, 4955, 10, 9
